using System.Windows.Forms;
using Belmost4PDA.Constants;
using Belmost4PDA.Fasade;

namespace Belmost4PDA.Logic
{
    public class Control_Memo : Control_PanelControl
    {
        public const int LineHeight = 25;
        private readonly HintTextBox textBox;

        public Control_Memo(PanelItem panelItem)
            : base(panelItem)
        {
            textBox = new HintTextBox();
            textBox.Tag = panelItem;
            textBox.Multiline = true;
            textBox.ScrollBars = ScrollBars.Both;
            textBox.AcceptsReturn = true;
            textBox.Height = LineHeight*panelItem.Lines;
        }

        public override string GetControlType()
        {
            return ControlType.Memo;
        }

        public override AbstractMapper GetMapper()
        {
            return new Mapper_EditBox(this);
        }

        public override Control GetFormControl()
        {
            return textBox;
        }

        public override string GetCaption()
        {
            return ((PanelItem)textBox.Tag).Caption;
        }
    }
}
